This invention relates to a memory media and a method controlled thereby for avoiding calculation ambiguities which result from the use of year dates from the year 2000 and forward and, more particularly, to an improved date format and method for the use thereof which avoids such calculation ambiguities and, at the same time, requires no modification of the size of date fields already present in current software.
Software applications use dates in a myriad of operations, from complex financial transactions to the expiration dates of driver""s license and credit cards. Many such applications base their calculations on dates, subtracting two-digit year values from one another to arrive at a calculation result. For example, calculations of interest on a 5-year certificate of deposit involves the subtraction of the CD""s issue date from the current date and a determination of interest based upon the difference. This is no problem if the CD matures in 1999, but if it matures in 2001, the same computations can result in an error message or worse.
In the year 2000, the two year digit indications start over at xe2x80x9c00xe2x80x9d, and unless something is done to distinguish such dates, they will appear to precede the year 1900xe2x80x94or so it will seem to many programs that use only the year""s last two digits for dates. The same problem is present in programs which process invoices, payrolls, credit card transactions, bill payments, inventory systems, databases that sort by year and many other computer operations.
In the early days of data processing, storage space was at a premium and it was decided to use two digits for the year indication. As a result, most programs today employ two bytes of EBCDIC data to indicate the last two decimal values of the year. While it appears straightforward to convert a two byte decimal year indication to a four decimal year indication, the problem is that a monumental number of programs must be. searched and corrected. Further, each correction, if performed in the manner taught by the prior art, must involve an expansion of date fields, or some windowing technique; a revision of job control languages to cope with the date field change and the alteration of each application in such a manner as to accommodate the changed date field.
A conventional format for decimal representation of the year, called xe2x80x9czoned decimalxe2x80x9d, is shown in FIG. 1 as four characters FnSn. Each n character represents a decimal digit of the year and is expressed as 0 to 9. The F character is always a hexadecimal F for printing purposes. The S character has possible values of C, D, E or F in hexidecimal, as spelled out by EBCDIC Standards, to show whether the whole data string is to be positive or negative for sign purposes.
From an examination of FIG. 1, it can be seen that conversion of the zoned decimal format to handle a full four digit date would require that programs be converted by expanding field lengths and changing all media and logic that handle the expanded field lengths. The. conversion process (i) is extraordinarily large, (ii) must be accomplished and in place as soon as possible to take care of the xe2x80x9cyear 2000xe2x80x9d problem and (iii) requires that all cooperating programs be converted before they can be operated in conjunction with each other.
Accordingly, it is an object of this invention to provide a date format, which is compatible with widely used current date formats and whose use avoids ambiguous calculation results.
It is another object of this invention to provide a procedure for employing a date format that enables conventional as well as future programs to operate on such date format.
It is still another object of this invention to provide a memory media for operation in conjunction with a program operating on a computer for the processing of date data.
The present invention employs a pseudo zoned decimal format to represent date information. The pseudo zoned decimal format differs from the zoned decimal format in that the value of the character corresponding to the F character of the zoned decimal format is permitted to vary in hexidecimal value from 0 to E to represent century information, but is not permitted to have a value of F. This permits a range of 14 centuries from a base century.
The method of processing date data according to the present invention involves intercepting year date data that has a higher order field that contains a hexidecimal character and one or more data fields that contain the year information. Then it is detected whether the hexidecimal character field has a hexidecimal value in the range of 0 to E. If yes, the detected value is added to a base century to form the proper century for the year date.
The method according to the present invention in one preferred embodiment forms revised data containing the year and century information. The revised data may be made available to an application.
The intercepted data is prepared for print or display operations, by changing the value of the hexidecimal character in the higher order field of the year data in the revised data to an hexidecimal F.
In another preferred embodiment of the present invention, if the hexidecimal character in the higher order field of the date data is an F, the year date data is converted to a pseudo zoned decimal format. This is accomplished by assigning a value in the hexidecimal range of 0 to E that corresponds to the desired century.
A memory media according to the present invention includes control software for operation in conjunction with a program operating on a computer to process year date data. The memory media includes first means for intercepting year date data that has a higher order field that contains a hexidecimal character and one or more data fields that contain the year information. A second means detects whether the hexidecimal character field has a hexidecimal value in the range of 0 to E. If yes, a third means adds the detected value to a base century to form the proper century for the year date.
The memory media according to the present invention in one preferred embodiment has a fourth means for forming revised data containing the year and century information. The revised data may be made available to an application.
For print or display operations, the memory media may contain a fifth means for changing the hexidecimal value in the higher order field of the year data in the revised data to an hexidecimal F. If the second means detects that the hexidecimal character in the higher order field of the year date data is an F, a sixth means is operable to convert the date data to a pseudo zoned decimal format. This is accomplished by assigning the hexidecimal character a value in the hexidecimal range of 0 to E that corresponds to the desired century.